package 力扣热题100;

import javax.swing.tree.TreeNode;
import java.util.ArrayList;
import java.util.List;

 class TreeNode1 {
      int val;
      TreeNode1 left;
      TreeNode1 right;
      TreeNode1() {}
      TreeNode1(int val) { this.val = val; }
      TreeNode1(int val, TreeNode1 left, TreeNode1 right) {
          this.val = val;
          this.left = left;
          this.right = right;
      }
 }
public class LeetCode37 {
    List<Integer>list=new ArrayList<>();
    public List<Integer> inorderTraversal(TreeNode1 root) {
        find(root);
        return list;
    }

    private void find(TreeNode1 root) {
        if(root==null){
            return;
        }
        find(root.left);
        list.add(root.val);
        find(root.right);
    }
}
